chdir $1
Ef=`awk '{if(NR==6)print $4}' DOSCAR`

H=`egrep "^band" PROCAR |sort -n -k 5|awk '{if($5<'$Ef')h=$5}END{print h}'`

L=`egrep "^band" PROCAR |sort -n -k 5|awk '{if($5>'$Ef')print $5}'|head -1`

echo $H
echo $L
echo "$L" - "$H"|bc